
public class Word {
	public char[] data;
	
	public Word(String str){
		data = str.toCharArray();
	}
	
	public Word(Word w){
		data = new char[w.data.length];
		for(int i=0; i<w.data.length; i++){
			this.data[i] = w.data[i];
		}
	}
	
	public Word(char[] str){
		data = new char[str.length];
		for(int i=0; i<str.length; i++){
			data[i] = str[i];
		}
	}
	
	@Override
	public boolean equals(Object o){
		if(o instanceof Word){
			Word other = (Word) o;
			if(other.data.length == this.data.length){
				boolean success = true;
				for(int i=0; i<this.data.length; i++){
					if(other.data[i] != this.data[i])
						success = false;
				}
				return success;
			}
		}
		return false;
	}
	
	@Override
	public int hashCode(){
		return (int) JenkinsHash.hash(data);
	}
	
	@Override
	public String toString(){
		return new String(data);
	}
	
	
}
